<template>
  <view class="flex-col shorthand_detail_container">
    <navbar :title="title"></navbar>
    <view class="flex-col shorthand-container">
      <view class="flex-col " style="padding: 36rpx" v-for="(item,i) in list" :key="i">
        <text class="detail-title">{{ i + 1 + '、' + item.title }}</text>
        <text class="detail-describe" v-if="item.content">{{ item.content }}</text>
        <image :src="item.img" v-if="item.img" class="detail-img" mode="widthFix"></image>
      </view>
      <view class="hide-skill" v-if="!isKemu1VIP&&!isKemu4VIP">
        <view class="mask">
          <view v-for="n in 100" :key="n">
            <view v-for="n in 30" class="col" :key="n">驾校考试通</view>
          </view>
        </view>
        <view class="lock-icon"></view>
        <view class="btn" @click="goVip">解锁口诀</view>
      </view>
    </view>
    <!--    <view class="problem-btn" @click="aboutAction">-->
    <!--      <text>相关试题{{ count }}道</text>-->
    <!--    </view>-->
  </view>
</template>

<script>
import {mapGetters} from 'vuex'
import Navbar from "../../components/navbar";
import {shorthandApi} from "@/api";

export default {
  components: {Navbar},
  data() {
    return {
      title: null,
      count: null,
      id: null,
      list: []
    }
  },
  async onLoad({id, title, count}) {
    const res = await shorthandApi.items(id)
    this.list = res.data.data.list
    this.id = id
    this.count = count
    this.title = title
  },
  computed: {
    ...mapGetters(['appName', 'isKemu1VIP', 'isKemu4VIP']),
  },
  methods: {
    goVip() {
      uni.navigateTo({
        url: '/pages/vip/vip',
      });
    }
  }
}
</script>

<style lang="scss">
.shorthand_detail_container {
  background-color: #fff;

  .detail-title {
    color: #2F98F2;
    font-size: 30rpx;
    font-weight: bold;
  }

  .shorthand-container {
    .hide-skill {
      position: fixed;
      top: 0;
      bottom: 0;
      right: 0;
      left: 250rpx;
      background-color: #fff;
      box-shadow: 0px -20px 50px 20px #fffa;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      .lock-icon {
        width: 58rpx;
        height: 58rpx;
        background-image: url("http://down.qwdata.vip/app_icon/1686907977140");
        background-size: cover;
        z-index: 5;
        margin-bottom: 30rpx;
      }

      .btn {
        background-image: linear-gradient(90deg, #f8dcc6, #edc5a3);
        height: 80rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 100rpx;
        border-radius: 100rpx;
        font-weight: bold;
        z-index: 5;
        color: #694837;
      }

      .mask {
        position: absolute;
        top: -50px;
        left: -400px;
        width: 1000px;
        height: 1000px;
        overflow: hidden;
        transform: rotate(45deg);
        font-weight: bold;
        z-index: 0;
        color: #eee;

        .col {
          line-height: 30px;
          margin-right: 20px;
          display: inline-block;
        }
      }
    }
  }

  .detail-describe {
    color: #595959;
    font-size: 28rpx;
    margin-top: 18rpx;
  }

  .detail-img {
    margin-top: 16rpx;
    height: 240rpx;
  }

  .problem-btn {
    display: flex;
    width: 356rpx;
    height: 94rpx;
    border-radius: 48rpx;
    justify-content: center;
    align-items: center;
    align-self: center;
    bottom: 138rpx;
    background-color: #3276F4;
    position: fixed;
    z-index: 1;
    color: #FFFFFF;
    font-size: 30rpx;
  }
}

</style>
